var e = require("../../../../@babel/runtime/helpers/typeof"), t = getApp();

Page({
    data: {
        language: "",
        total: "",
        activeName: "first",
        first_content: [],
        second_content: [],
        third_content: []
    },
    onLoad: function(e) {
        this.checkrouter(), this.initInfo(), this.getFixedRewardLog();
    },
    checkrouter: function() {
        try {
            var t = function() {
                for (var e = wx.getStorageSync("yz_basic_info"), t = e.popularize_page.mini.vue_route, n = 0; n < t.length; n++) if ("fixedReward" == t[n]) return console.log(e.popularize_page.mini.mini_url + "跳转的路径"), 
                wx.showToast({
                    title: "未开启推广权限",
                    duration: 1e3,
                    icon: "none",
                    success: function() {
                        setTimeout(function() {
                            wx.redirectTo({
                                url: e.popularize_page.mini.mini_url
                            });
                        }, 1e3);
                    }
                }), {
                    v: void 0
                };
            }();
            if ("object" === e(t)) return t.v;
        } catch (e) {
            console.log(e);
        }
    },
    onReady: function() {
        var e = wx.getStorageSync("langIndex");
        this.setData({
            language: e.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    initInfo: function() {
        var e = this, n = t.getNetAddresss("plugin.fixed-reward.api.fixed-reward.get-fixed-reward-amount");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 === n.result ? e.setData({
                    total: n.data.total
                }) : wx.showToast({
                    title: n.msg,
                    icon: "none"
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    getFixedRewardLog: function() {
        var e = this, n = t.getNetAddresss("plugin.fixed-reward.api.fixed-reward.get-fixed-reward-log");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 === n.result ? e.setData({
                    first_content: n.data
                }) : wx.showToast({
                    title: n.msg,
                    icon: "none"
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    }
});